/***************************************************************************
 *   Copyright (C) 2007 by Gaetano Mendola   *
 *   mendola@bigfoot.com   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef STAT_H
#define STAT_H

#include <list>

namespace Stats {

//forward declaration
class Modifier;


enum StatType {
    WEAPON_SPEED = 0,
    INTELLECT    = 1,
    AGILITY      = 2,
    STAMINA      = 3,
    HEALING      = 4,
    ATTACK_POWER = 5
};

/**
    @author Gaetano Mendola <mendola@bigfoot.com>

    This class mantains the value of various stats, weapons speeds,
    agility, attack power and such, it has a list of modifiers so
    when asked for the value it will apply them.
*/
class Stat {
public:
    typedef unsigned long type_value;

    explicit Stat(type_value aValue, StatType aType);
    ~Stat();

    operator type_value() const;
    StatType type() const { return theType; }

    void addModifier(const Modifier* aModifier);
    void removeModifier(const Modifier* aModifier);

private:

    type_value theInitialValue;
    StatType   theType;

    typedef std::list<const Modifier*> Modifiers;
    Modifiers theModifiers;

}; //class Stat

} //namespace Stats

#endif
